import { useNavigate } from 'react-router-dom';
import { login } from '@/api'

const Login = () => {
  const navigate = useNavigate()
  const toHome = async () => {
    await login()
    navigate('/test')
  }
  return (
    <div>
      <h2>
        login
      </h2>
      <button onClick={toHome}>to home</button>
    </div>
  );
};

export default Login